package base.thread.jdkapidemo;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicCounter {
	private AtomicInteger count=new AtomicInteger();
	
	public int getValue(){
		return count.get();
	}
	
	public int increment(){
		return count.incrementAndGet();
	}
	public int increment(int i){
		return count.addAndGet(i);
	}
	public int decrement(){
		return count.decrementAndGet();
	}
	public int decrement(int i){
		return count.addAndGet(-i);
	}
	
}
